﻿

Public Class cGossipMenuOption
    Inherits SortedList(Of String, sMysqlItem)

    Public Property option_icon As UInt32
        Get
            If Me.ContainsKey("option_icon") Then
                Return Me.Item("option_icon").Value
            Else
                Return 0
            End If
        End Get
        Set(value As UInt32)
            Stop
        End Set
    End Property
    Public Property option_text As String
        Get
            If Me.ContainsKey("option_text") Then
                Return Me.Item("option_text").Value
            Else
                Return ""
            End If
        End Get
        Set(value As String)
            Stop
        End Set
    End Property
    

    Public Shared Function Read(conn As MySQL, menu_id As UInt32, id As UInt32) As cGossipMenuOption
        If IsNothing(conn) Then Throw New ArgumentNullException("cGossipMenuOption: conn is nothing")
        Dim sql As String = "SELECT * FROM gossip_menu_option WHERE menu_id=" & menu_id & " AND id=" & id & ";"
        Return conn.ReadRow(sql)
    End Function


End Class
